home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
ai
/
prlg195b.lzh
/
EXPERT.LZH
/
PRODSYS
/
AXBCPD.PRO
< prev
next >
Wrap
Text File
|
1980-01-01
|
3KB
|
47 lines
obj('VERY BAD'):-gen('symbolic') , gen('oper') , affirm('result: x-c = -b/a').
obj('BAD: a divide to c'):-gen('symbolic'),gen('oper'),
affirm('result: x = c - b/a').
obj('BAD: a divide to b'):-gen('symbolic'),gen('oper'),affirm('x = c/a - b').
obj('WELL'):-gen('symbolic') , gen('oper'),
affirm('x = c/a - b/a') ,affirm('or: x = (c - b)/a').
obj('CONFUSE'):- gen('zero_b') , affirm('is tricky') ,
affirm('could be a = 0') , affirm('tricky x = 0?').
obj('OPTIMUM'):- gen('zero_b'),gen('zero_b'),deny('x = c'),affirm('x = c/a').
obj('BAD: a divides c'):- gen('b_zero'),affirm('insist x = c').
obj('BAD:lacks division 1st term'):- gen('numeric'),
datum(a(A)),datum(b(B)),datum(c(C)), V is -1*B,
print(' x = ',C,' + (',V,'/',A,') '),affirm('right').
obj('BAD:lacks division 2nd term'):-
datum(a(A)),datum(b(B)),datum(c(C)), V is -1*B,
print(' x = ',C,'/',A,' + ',V,' '),affirm('is ok').
obj('BAD: sign error'):- datum(a(A)),datum(b(B)),datum(c(C)), V is -1*B,
print(' x = ',C,'/',A,' - (',V,'/',A,') '),affirm('is final').
obj('FINE'):- datum(a(A)),datum(b(B)),datum(c(C)),M is C/A, N is B/A,
print('x = ',C,'/',A,' - (',B,'/',A,') '),affirm('obvious'),
print('x = ',M,' - (',N,') '),affirm('that`s it'), Q is M - N,
print('x = ',Q,' '), affirm('verify').
obj('BAD: lacks division by c'):-gen('b_zero'),affirm('insist x = c').
gen('symbolic'):-affirm('analize symbolically ax + b = c'),affirm('a # 0'),
affirm('b or c could be 0').
gen('oper'):- affirm('b # 0'),affirm('b pass negated to right'),
affirm('divide by a').
gen('zero_b'):-gen('symbolic'),affirm('make b = 0'),
affirm('divide by a').
gen('zero_b'):- gen('symbolic'),deny('x = c').
gen('b_zero'):- gen('symbolic'),affirm('insist x = c').
gen('numeric'):-affirm('have assigned values to: a,b,c in ax + b = c'),!,
datum(a(A)),datum(b(B)),datum(c(C)),
print(A,'x + ',B,' = ',C),nl,affirm('is the equation').
gen('numeric'):-print('ERROR: assign numerical values\n\t\tRET'),ratom(_),menu.
data:-cls,print('\nNumerical values (FLOAT or INT) for: a,b,c in ax + b = c'),
print('\nOnly integers, divisions rounded to integers, try b,c>a <RET>,'),
print('\nWrite :\n'),
print('a = '),rnum(A),asserta(datum(a(A))),
print('b = '),rnum(B),asserta(datum(b(B))),
print('c = '),rnum(C),asserta(datum(c(C))),asserta(datum(yes)),menu.
data:- print('\nERROR a MUST BE # 0\t\t\t\RET'),ratom(_),menu.